<?php
   class Gift extends AppModel {
        var $alias  =   'Gift';
        var $name = 'Gift';
        var $useTable = 'gifts';
        var $hasMany    =   array(
            'Giftphoto'  =>  array(
                'className' =>  'Giftphoto',
                'foreignKey'    =>  'gift_id',
                'dependent' =>  true,
            )
        );
        function paginateCount($conditions = null, $recursive = 0, $extra = array()) {
            $parameters = compact('conditions');
            $this->recursive = $recursive;
            $count = $this->find('count', array_merge($parameters, $extra));
            if (isset($extra['group'])) {
                $count = $this->getAffectedRows();
            }
            return $count;
        }
    }


?>
